{include file="common/header" /}
<link rel="stylesheet" href="/kindeditor/themes/default/default.css" />
<script type="text/javascript" src="/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript" src="/kindeditor/lang/zh_CN.js"></script>
<script>
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('textarea[name="content"]', {
            allowFileManager : true
        });
    });
</script>
        <section class="content-header">
          <h1>
            场馆修改
          </h1>
          <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-home"></i> 首页</a></li>
            <li class="active">场馆预约</li>
            <li class="active">场馆修改</li>
          </ol>
        </section>

        <section class="content">

          <div class="box box-default">
            <div class="box-header with-border">
              <h3 class="box-title">
                  <a href="/admin/venreserve/index" ><span class="label label-back" ><i class="fa fa-chevron-left"></i> 返回</span></a>
              </h3>
            </div>
      
      <form id="from1" name="from1" method="post" enctype="multipart/form-data" action="">
        <input type="hidden" name="id" value="{$info.id}">
            <div class="box-body">
				<div class="row">
				  <div class="col-md-6 form-group">
					<label>场馆名称</label>
					<input name="title" type="text" value="{$info.title}" class="form-control" required="required" />
				  </div>
				</div>
                <div class="row">
                    <div class="col-md-6 form-group">
                        <label>场馆管理员姓名</label>
                        <input name="manager" id="manager" type="text" value="{$info.manager}" class="form-control" onfocus="this.blur()"/>
						<input name="managerid" type="hidden" id="managerid" value="{$info.managerid}" />
						<div style="position:absolute; top:31px; right:20px;">
							<a class="layerbox" title="选择管理员" href="/admin/venreserve/receiver"><span class="label label-success"><i class="fa fa-plus"></i> 选择人员</span></a>
						</div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 form-group">
                        <label>场馆联系电话</label>
                        <input name="telephone" type="text" value="{$info.telephone}" class="form-control" required="required" />
                    </div>
                </div>
				<div class="row">
                    <div class="col-md-6 form-group">
                        <label>场馆地址</label>
                        <input name="address" type="text" value="{$info.address}" class="form-control" required="required" />
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6 form-group">
                        <label>场馆运行时间</label>
                        <input name="opentime" id="opentime" type="text" value="{$info.opentime}" class="form-control" required="required" />
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-8 form-group">
                        <label>场馆介绍：</label>
                        <textarea class="form-control" id="content" name="content" placeholder="请输入内容" autocomplete="off" style="width:800px;height:400px;visibility:hidden;"  >{$info.content}</textarea>
                    </div>
                </div>
				<div class="row">
                  <hr />
                  <div class="col-md-6 form-group">
                    <label>场馆图片</label>
                    <div class="form-group">
					{if $info.img}
                    <img id="venreserve_img" src="/uploads/venreserve/{$info.img}" width="187px"/>
                    {else}
                    <img id="venreserve_img" src="/images/adefault.png" width="187px" />
					{/if}
				  </div>
                    <div class="form-group">
                        <div class="btn btn-default btn-file">
                            <i class="fa fa-upload"></i> 上传图片
                            <input type="file"  name="img" onchange="ChkUploadImage(this,venreserve_img);" value="/uploads/venreserve/{$info.img}"/>
                        </div>
                        <p class="help-block">上传场馆的缩略图</p>
                    </div>
                  </div>
                    <div class="col-md-1 form-group">
                      <label>状态</label>
                      <br />
                      <input id="status" type="checkbox" name="status" value="Y"{if condition="$info.status eq 1 || !$info"} checked{/if} />正常
                    </div>
				</div>
            </div>
            <div class="box-footer">
                <input type="submit"  value="保存" class="btn btn-primary" />
                <input type="button" value="取消" onclick="javascript:history.back(-1);"  class="btn btn-default" />
            </div>    
      </form>
          </div>
        </section>
<script>
//上传图片检查并显示预览图
function ChkUploadImage(ct_file, ct_image) {
  var fileext = ct_file.value.substring(ct_file.value.lastIndexOf("."), ct_file.value.length);
  fileext = fileext.toLowerCase();
  if ((fileext != '.jpg') && (fileext != '.gif') && (fileext != '.jpeg') && (fileext != '.png')) {
	  alert("Please upload image.");
	  ct_file.focus();
	  ct_file.outerHTML = ct_file.outerHTML;
  }
  else {
	  ct_image.style.display = "block";
	  ct_image.src = window.webkitURL.createObjectURL(ct_file.files[0])
  }
}
</script>   
{include file="common/footer" /}
